home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 3 / CU Amiga Magazine's Super CD-ROM 03 (1996)(EMAP Images)(GB)(Track 1 of 3)[!][issue 1996-09].iso / graphics / gfxlab24 / arexxscripts / oilpainting.rexx < prev   
OS/2 REXX Batch file  |  1995-06-01  |  4KB  |  92 lines

  1. /*   OilPainting.rexx                                             */
  2. /*                         Rodrigo Reyes 1995                     */
  3. /*                                                                */
  4.  
  5. /*                                                                */
  6. /* This script takes some files on its command line, and process  */
  7. /* some effect on them, which should give something like oil -    */
  8. /* painting.                                                      */
  9. /*                                                                */
  10. /* The script save the oiled picture as FILENAME.oil.jpeg.        */
  11.  
  12.  
  13. /* To use this script, type inside a command shell :              */
  14. /*                                                                */
  15. /*     rx emptyscript.rexx FILENAME                               */
  16. /*                                                                */
  17. /*  example :                                                     */
  18. /*                                                                */
  19. /*     rx ArexxScripts/oilpainting.rexx #?.gif b.jpeg c.ilbm      */
  20. /*     rx ArexxScripts/oilpainting.rexx dh0:pic/#?                */
  21. /*                                                                */
  22. /* Dont forget that if the full path is not added, the pictures   */
  23. /* will be searched in the current directory of GFXLAB24, not     */
  24. /* the one of the shell that launched the script.                 */
  25.  
  26. /* Of course, under Csh and other Unix shells, you should not     */
  27. /* use #? but "*" instead. The reason is that unix shells don't   */
  28. /* send the pattern, but replace it directly by the corresponding */
  29. /* file names and #? is not understood by Csh.                    */
  30.  
  31.  
  32.          /* Address the GfxLab24 Arexx port */
  33.  
  34. ADDRESS GFXLAB24.0
  35. options results
  36.  
  37.          /* Put here your inits             */
  38.  
  39.  
  40.          /* Print a message in GfxLab24 info window */
  41.  
  42. PrintInfo ''
  43. PrintInfo '"Beginning of the OilPainting AREXX script"'
  44. PrintInfo '"Script by Rodrigo Reyes, 1995"'
  45.  
  46. GfxListIndex = 1    /* Scan all the names in the command line */
  47.                     /* that was given to the script, starting */
  48.                     /* with the value in 'GfxListIndex', until there */
  49.                     /* is no more names in command line       */
  50.                     /* (while the current name is not empty)  */
  51. DO UNTIL word(arg(1),GfxListIndex)=''
  52.  
  53.                     /* Get name from the command line */
  54.     GfxMyList = WORD(arg(1), GfxListIndex)
  55.     GfxListIndex = GfxListIndex + 1
  56.  
  57.                 /* GetFromPattern is a GfxLab24 function that  */
  58.                 /* return a list of filenames corresponding to */
  59.                 /* the given argument. This argument should be */
  60.                 /* a pattern, but a single filename is ok and  */
  61.                 /* bug-proof.                                  */
  62.  
  63.     GetFromPattern GfxMyList
  64.     GfxMyList = result
  65.     if (WORD(GfxMyList,1)="ERROR") Then Exit
  66.     GfxsubListIndex = 1
  67.     DO UNTIL word(GfxMyList,GfxsubListIndex)=''
  68.         FileName = word(GfxMyList,GfxsubListIndex)
  69.         GfxsubListIndex = GfxsubListIndex +1
  70.  
  71.         PrintInfo '"Processing 'FileName '"'
  72.         Load FileName               /* Load the picture */
  73.         if result = "OK" then
  74.              DO
  75.                         /* Add want you want here */
  76.  
  77.                  DispersePixel 1
  78.                  Quake 3
  79.                  Quake 3 VERTICAL
  80.                  Convolve "convolve/triangle"
  81.  
  82.                         /* Free empty space for you script ... :)  */
  83.  
  84.                   Save FileName".oil.jpeg" JPEG
  85.  
  86.              END
  87.     END
  88. END
  89. PrintInfo '"End of the OilPainting Script"'
  90.  
  91.  
  92.